import { RoleFace, userInfoFace } from "../utils/types";
import { GetAction, PostAction } from "./request";



export const Http = {

    getTestApi: () => GetAction('/api/test'),

    getBanner: () => GetAction('http://121.196.235.163:3000/banner'),

    register: (data: userInfoFace) => PostAction('/api/register', data),

    login: (data: userInfoFace) => PostAction('/api/login', data),

    chechphone: (data: userInfoFace) => PostAction('/api/chechphone', data),

    // 发送验证码接口 
    captchaSent: (data: userInfoFace) => GetAction('http://121.196.235.163:3000/captcha/sent', data),

    // 校验验证码
    captchaVerify: (data: userInfoFace) => GetAction('http://121.196.235.163:3000/captcha/verify', data),

    gettoken: (data: userInfoFace) => PostAction('/api/gettoken', data),

    getuserinfo: (data?: userInfoFace) => PostAction('/api/getuserinfo', data),

    changepass: (data?: userInfoFace) => PostAction('/api/changepass', data),



    changeuserinfo: (data?: userInfoFace) => PostAction('/api/changeuserinfo', data),

    uploadfile: (data?: any) => PostAction('/api/uploadfile', data),

    // role 权限
    getrolelist: (data?: RoleFace) => PostAction('/api/getrolelist', data),

    roledelete: (data?: RoleFace) => PostAction('/api/roledelete', data),

    roleadd: (data?: RoleFace) => PostAction('/api/roleadd', data),

    roleupdate: (data?: RoleFace) => PostAction('/api/roleupdate', data),


    // 公告
    annoadd: (data?: any) => PostAction('/api/annoadd', data),

    getannolist: (data?: any) => PostAction('/api/getannolist', data),

    annodelete: (data?: any) => PostAction('/api/annodelete', data),

    annoupdate: (data?: any) => PostAction('/api/annoupdate', data),

    getannodetail: (data?: any) => PostAction('/api/getannodetail', data),

    // 用户
    adduser: (data?: any) => PostAction('/api/adduser', data),

    getuserlist: (data?: any) => PostAction('/api/getuserlist', data),

    deleteuser: (data?: any) => PostAction('/api/deleteuser', data),

    updateuser: (data?: any) => PostAction('/api/updateuser', data),

    // 学科
    addxueke: (data?: any) => PostAction('/api/addxueke', data),

    getxuekelist: (data?: any) => PostAction('/api/getxuekelist', data),

    deletexueke: (data?: any) => PostAction('/api/deletexueke', data),

    updatexueke: (data?: any) => PostAction('/api/updatexueke', data),

    // 班级
    addclass: (data?: any) => PostAction('/api/addclass', data),

    getclasslist: (data?: any) => PostAction('/api/getclasslist', data),


    // 意见
    addadvise: (data?: any) => PostAction('/api/addadvise', data),

    getadviselist: (data?: any) => PostAction('/api/getadviselist', data),

    deleteadvise: (data?: any) => PostAction('/api/deleteadvise', data),

    updateadvise: (data?: any) => PostAction('/api/updateadvise', data),

    getadviseone: (data?: any) => PostAction('/api/getadviseone', data),

} 